package com.easy.stock.dao;

import com.easy.stock.domain.StockInsideTrade;

public class StockInsideTradeDao extends BaseDao {
	
	public void addTrade(StockInsideTrade trade) {
		
		String query = "{stock_id:\"" + trade.getStock_id() 
				+ "\",insider_name:\"" + trade.getInsider_name()
				+ "\",title:\"" + trade.getTitle()
				+ "\",time:#} , "
				+ "{action:\"" + trade.getAction()
				+ "\",shares:\"" + trade.getShares()
				+ "\", price:\"" + trade.getPrice()
				+ "\",total:\"" + trade.getTotal()
				+ "\"}";
		
		getCollection().update(query, trade.getTime()).upsert().with(trade);
	}
}
